from django.contrib import admin
from .models import device,service,Employee
# Register your models here.

class deviceAdmin(admin.ModelAdmin):
    list_display=('device_hostname','device_address','device_type','device_contact')
    exclude = ['device_contact']
    def save_model(self,request,obj,form,change):
        obj.device_contact = str(request.user)
        obj.save()

class serviceAdmin(admin.ModelAdmin):
    list_display=('service_name','service_project','service_type','service_contact')
    exclude = ['service_contact']
    def save_model(self,request,obj,form,change):
        obj.service_contact = str(request.user)
        obj.save()


admin.site.register(service,serviceAdmin)
admin.site.register(device,deviceAdmin)
admin.site.register(Employee)
